"""已为常用搜索词定义模型类的文件."""
from datetime import date
from fastapi import Body, Query
from pydantic import BaseModel, Field


class CreatePopularRequest(BaseModel):
    """一种热门搜索词注册请求模型"""
    fields: str = Body(..., title="搜索字段", description="搜索字段")
    word: str = Body(..., title="搜索词", description="搜索词")


class PopularRequest(BaseModel):
    """热门搜索词请求模型"""
    limit: int = Field(Query(default=10, title="查询的数量", description="查询的数量"))
    day: int = Field(Query(default=3, title="期间", description="从今天开始 {day}前一天"))


class PopularResponse(BaseModel):
    """热门搜索词响应模型"""
    pp_word: str
    count: int
